cmake_minimum_required(VERSION 2.8)
project(USE_GTEST)

include_directories(${PROJECT_SOURCE_DIR}/foo)

add_subdirectory(foo)
add_subdirectory(src)

option(BUILD_TESTS "如果開啟，則編譯單元測試" ON)

if (BUILD_TESTS)
  enable_testing()
  add_subdirectory(gtest-1.7.0)
  include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})

  add_subdirectory(test)

  add_test(NAME runUnitTests COMMAND runUnitTests)
endif (BUILD_TESTS)